home *** CD-ROM | disk | FTP | other *** search
- Path: bunyip.cc.uq.oz.au!news
- From: coonsta@peg.apc.org
- Newsgroups: comp.lang.c
- Subject: Q: Getting data from a FAR CHAR * buffer: HELP!
- Date: 25 Jan 1996 04:47:04 GMT
- Organization: University of Queensland
- Message-ID: <4e7208$iqb@dingo.cc.uq.oz.au>
- NNTP-Posting-Host: t27.dialup.peg.apc.org
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (Windows; I; 16bit)
-
- Here is the structure and relevant buffer, which contains the data I want
- to extract (ultimately, I want plain ints):
-
- typedef struct pcx_picture_typ
- {
- pcx_header header; //Forget it: it's irrelevant
- RGB_color pallette[256]; //Forget this too.
- char far *buffer; //That's the one.
- } pcx_picture, *pcx_picture_pointer;
-
-
- Every pcx_picture is initalised with this call, which allocates memory
- for the buffer. I don't think it makes any difference, but here 'tis:
-
- void PCX_Init(pcx_picture_ptr image)
- {
- image->buffer = (char far *)_fmalloc(64000);
- }
-
- Anywho... say I have an integer called x, and I want the data in
- buffer[32000], what would I do? E.G.
-
- void main(void)
- {
- int x;
- pcx_picture thepicture;
-
- . (The buffer is initialised and filled with data from a file
- . in here).
- .
-
- x = thepicture.buffer[32000]; // doesn't seem to work.
- }
-
-
- can ANYBODY PLEASE help!
- -Dom 'The Definitive Newbie' Cooney.
-
-
-